package com.lingnan.blog.service;

import com.lingnan.blog.entity.ArticleTag;
import com.lingnan.blog.mapper.ArticleTagMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author HeGuanChao
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ArticleTagsService {
    @Autowired
    private ArticleTagMapper articleTagMapper;

    public ArticleTag findByAid(Integer aid){
        return articleTagMapper.selectByAid(aid);
    }

    public int save(ArticleTag articleTag){
        return articleTagMapper.insertSelective(articleTag);
    }

    public int update(ArticleTag articleTag){
        return articleTagMapper.updateByPrimaryKeySelective(articleTag);
    }
}
